package com.power.project.enums;

public enum CustomNodeTypeEnum {
    DEPART(0, "树形部门"),
    USER(1, "树形人员");
    private Integer code;

    private String name;

    CustomNodeTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static CustomNodeTypeEnum getEnum(Integer code) {
        if (code == null) {
            return null;
        }
        for (CustomNodeTypeEnum item : CustomNodeTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
